import React, {ReactNode} from "react";
import {Button} from "antd";
import './myButton.scss'

interface IMyButtonProps {
    text: string,
    children?: ReactNode;
    type?: 'text' | 'primary' | 'link' | 'default' | 'dashed';
    ghost?: boolean,
    disabled?: boolean,
    loading?: boolean,
    size?: 'large' | 'middle' | 'small',
    danger?: boolean,
    onClick: () => void
}

const MyButton: React.FC<IMyButtonProps> =
    ({
         text,
         type = 'primary',
         ghost = false,
         disabled = false,
         loading = false,
         danger = false,
         size = 'middle',
         onClick
     }) => {
        return <div className="myButton">
            <Button
                type={type}
                ghost={ghost}
                disabled={disabled}
                loading={loading}
                size={size}
                danger={danger}
                onClick={onClick}
            >
                {text}
            </Button>
        </div>
    }
export default MyButton

export type {IMyButtonProps}
